﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using IFViewDetail.KuaiQi;
using HCY.CTP.DBShangZheng;

namespace FrmTryIF.Ctl.Demo
{
    public partial class FrmSelectDemoDatacs : DevExpress.XtraEditors.XtraForm
    {
        public FrmSelectDemoDatacs()
        {
            InitializeComponent();
        }
        public void Init()
        {
            var x = MyDBHelper.GetALLDemoData();
            gridControl1.DataSource = x;
        }
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
           
            var zi= gridView1.GetFocusedRow() as MyDBHelper.MyDBDataIF;
            if (zi != null)
            {
                _recid = zi.RecID;
                DialogResult = DialogResult.OK;
            }
            
            this.Close();
        }
        private int _recid;
        public int RecID { get { return _recid; } }
        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.Close();
        }

        private void gridControl1_DoubleClick(object sender, EventArgs e)
        {
            var zi = gridView1.GetFocusedRow() as MyDBHelper.MyDBDataIF;
            if (zi != null)
            {
                _recid = zi.RecID;
                DialogResult = DialogResult.OK;
            }

            this.Close();
        }
    }
}